import 'package:deepseek_client/dto/OllamaLocalModelDTO.dart';
import 'package:dio/dio.dart';
import 'package:retrofit/retrofit.dart';

import '../../dto/ChatResponseDTO.dart';
import '../../dto/ResponseDTO.dart';
part 'OllamaClient.g.dart';

@RestApi()
abstract class OllamaClient {
  factory OllamaClient(Dio dio, {String? baseUrl}) = _OllamaClient;




  ///发送消息，获取回复
  @DioResponseType(ResponseType.json)
  @POST("/api/generate")
  Future<ResponseDto> generateResponse(@Body() String body);


  ///发送消息，获取回复
  @DioResponseType(ResponseType.json)
  @POST("/api/chat")
  Future<ChatResponseDto> chat(@CancelRequest() CancelToken cancelToken, @Body() String body);



  ///发送消息，获取回复
  @POST("/api/chat")
  @DioResponseType(ResponseType.stream)
  Future<HttpResponse> chatWithStream(@CancelRequest() CancelToken cancelToken, @Body() String body);

  ///获取本地模型列表
  @GET("/api/tags")
  @DioResponseType(ResponseType.json)
  Future<OllamaLocalModelDto> getLocalModels();

}
